home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_315 / surf / menu_scrn.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  5KB  |  192 lines

  1. #include "scrndef.h"
  2. /*
  3.  * Menu description for selecting color mapping
  4.  */
  5.  
  6. /*
  7.  * define mutual exclusion flags
  8.  */
  9. #define MUBIT1 1
  10. #define MUBIT2 2
  11. #define MUBIT3 4
  12. #define MUBIT4 8
  13. #define MUBIT5 16
  14. #define MULO 32
  15. #define MUHI 64
  16. #define MUHAM 128
  17. #define MUOVER 256
  18.  
  19. static struct IntuiText scrntext[] = {
  20.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"2 color",  NULL },
  21.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"4 color ",   NULL },
  22.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"8 color", NULL },
  23.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"16 color",  NULL },
  24.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"32 color",  NULL },
  25.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"lores",  NULL },
  26.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"hires",  NULL },
  27.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"ham",  NULL },
  28.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"overscan",  NULL },
  29.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"interlace",  NULL },
  30. };
  31.  
  32. static struct MenuItem scrnitems[] = {
  33.   { &scrnitems[1], /* next item */
  34.     10, 0, 90 , 10, /* x,y,w,h */
  35.     COLMEMFLAGS ,
  36.     MUBIT2|MUBIT3|MUBIT4|MUBIT5, /* mutual exclude bits */
  37.     (APTR) &scrntext[0],  /* grey */
  38.     NULL, /* highlight image */
  39.     'h', /* command byte ? */
  40.     NULL, /* submenu item */
  41.     0 /* next select for select dragging */
  42.     },
  43.   { &scrnitems[2], /* next item */
  44.     10, 10, 90 , 10, /* x,y,w,h */
  45.     COLMEMFLAGS,
  46.     MUBIT1|MUBIT3|MUBIT4|MUBIT5, /* mutual exclude bits */
  47.     (APTR) &scrntext[1],  /* grey */
  48.     NULL, /* highlight image */
  49.     'h', /* command byte ? */
  50.     NULL, /* submenu item */
  51.     0 /* next select for select dragging */
  52.     },
  53.   { &scrnitems[3], /* next item */
  54.     10, 20, 90 , 10, /* x,y,w,h */
  55.     COLMEMFLAGS,
  56.     MUBIT1|MUBIT2|MUBIT4|MUBIT5, /* mutual exclude bits */
  57.     (APTR) &scrntext[2],  /* grey */
  58.     NULL, /* highlight image */
  59.     'h', /* command byte ? */
  60.     NULL, /* submenu item */
  61.     0 /* next select for select dragging */
  62.     },
  63.   { &scrnitems[4], /* next item */
  64.     10, 30, 90 , 10, /* x,y,w,h */
  65.     COLMEMFLAGS| CHECKED,
  66.     MUBIT1|MUBIT2|MUBIT3|MUBIT5, /* mutual exclude bits */
  67.     (APTR) &scrntext[3],  /* grey */
  68.     NULL, /* highlight image */
  69.     'h', /* command byte ? */
  70.     NULL, /* submenu item */
  71.     0 /* next select for select dragging */
  72.     },
  73.   { &scrnitems[5], /* next item */
  74.     10, 40, 90 , 10, /* x,y,w,h */
  75.     COLMEMFLAGS,
  76.     MUBIT1|MUBIT2|MUBIT3|MUBIT4|MUHI, /* mutual exclude bits */
  77.     (APTR) &scrntext[4],  /* grey */
  78.     NULL, /* highlight image */
  79.     'h', /* command byte ? */
  80.     NULL, /* submenu item */
  81.     0 /* next select for select dragging */
  82.     },
  83.   { &scrnitems[6], /* next item */
  84.     10, 50, 90 , 10, /* x,y,w,h */
  85.     COLMEMFLAGS| CHECKED,
  86.     MUHI|MUHAM, /* mutual exclude bits */
  87.     (APTR) &scrntext[5],  /* grey */
  88.     NULL, /* highlight image */
  89.     'h', /* command byte ? */
  90.     NULL, /* submenu item */
  91.     0 /* next select for select dragging */
  92.     },
  93.   { &scrnitems[7], /* next item */
  94.     10, 60, 90 , 10, /* x,y,w,h */
  95.     COLMEMFLAGS,
  96.     MULO|MUHAM|MUBIT5, /* mutual exclude bits */
  97.     (APTR) &scrntext[6],  /* grey */
  98.     NULL, /* highlight image */
  99.     'h', /* command byte ? */
  100.     NULL, /* submenu item */
  101.     0 /* next select for select dragging */
  102.     },
  103.   { &scrnitems[8], /* next item */
  104.     10, 70, 90 , 10, /* x,y,w,h */
  105.     (COLMEMFLAGS) & ~ITEMENABLED,
  106.     MULO|MUHI, /* mutual exclude bits */
  107.     (APTR) &scrntext[7],  /* grey */
  108.     NULL, /* highlight image */
  109.     'h', /* command byte ? */
  110.     NULL, /* submenu item */
  111.     0 /* next select for select dragging */
  112.     },
  113.   { &scrnitems[9], /* next item */
  114.     10, 80, 90 , 10, /* x,y,w,h */
  115.     ( COLMEMFLAGS|MENUTOGGLE)& ~ITEMENABLED ,
  116.     0, /* mutual exclude bits */
  117.     (APTR) &scrntext[8],  /* grey */
  118.     NULL, /* highlight image */
  119.     'h', /* command byte ? */
  120.     NULL, /* submenu item */
  121.     0 /* next select for select dragging */
  122.     },
  123.   { NULL, /* next item */
  124.     10, 90, 90 , 10, /* x,y,w,h */
  125.     COLMEMFLAGS|MENUTOGGLE,
  126.     0, /* mutual exclude bits */
  127.     (APTR) &scrntext[9],  /* grey */
  128.     NULL, /* highlight image */
  129.     'h', /* command byte ? */
  130.     NULL, /* submenu item */
  131.     0 /* next select for select dragging */
  132.     }
  133. };
  134.  
  135.  
  136.  
  137. void MenuSetScrn()
  138. {
  139.     UBYTE colmax;
  140.  
  141.     CloseSurf();
  142.  
  143.     /*
  144.      * overscan
  145.      */
  146.     SurfScrnDef.Width = 320;
  147.     SurfScrnDef.Height = 200+ButHeight;
  148.     SurfScrnDef.LeftEdge = SurfScrnDef.TopEdge = 0;
  149.  
  150.     if( Selected(scrnitems[8])) {
  151.         SurfScrnDef.Width = 352;
  152.         SurfScrnDef.Height = 220;
  153.     }
  154.  
  155.     if( Selected(scrnitems[7])) { /* ham mode */
  156.         SurfScrnDef.Depth = 6;
  157.         SurfScrnDef.ViewModes = HAM;
  158.     }
  159.     else {
  160.         int i;
  161.         SurfScrnDef.Depth = 3; /* incase non of the flags are set */
  162.  
  163.         for( i = 0; i < 5; i++ ) {
  164.             if( Selected( scrnitems[i])) {
  165.                 SurfScrnDef.Depth = i+1;
  166.             }
  167.         }
  168.  
  169.         if( Selected( scrnitems[5] ) ) { /* lores */
  170.             SurfScrnDef.ViewModes = 0;
  171.         }
  172.         else {
  173.             SurfScrnDef.ViewModes = HIRES;
  174.             SurfScrnDef.Width <<= 1;
  175.             SurfScrnDef.LeftEdge *= 2;
  176.             if( SurfScrnDef.Depth > 4 ) {
  177.                 SurfScrnDef.Depth = 4;
  178.             }
  179.         }
  180.     }
  181.  
  182.     if( Selected( scrnitems[9] )) {   /* interlace */
  183.         SurfScrnDef.Height <<= 1;
  184.         SurfScrnDef.Height -= ButHeight;
  185.         SurfScrnDef.TopEdge *= 2;
  186.         SurfScrnDef.ViewModes |= LACE;
  187.     }
  188.  
  189.  
  190.     OpenSurf();
  191. }
  192.